home *** CD-ROM | disk | FTP | other *** search
- -------------------------------------------------------------------------
- | VGABIOS.DOC |
- | This document describes the IBM Standard VGA BIOS functions |
- | and their usage. |
- -------------------------------------------------------------------------
-
- The following is a summary of the standard IBM VGA BIOS functions:
-
- ;***************************************************************
-
- ah = 00h - Set Mode
- ah = 01h - Set Cursor Type
- ah = 02h - Set Cursor Position
- ah = 03h - Read Cursor Position
- ah = 04h - Read Light Pen Position (EGA and CGA only)
- ah = 05h - Select Active Display Page
- ah = 06h - Scroll Active Page Up
- ah = 07h - Scroll Active Page Down
- ah = 08h - Read Attribute/Character at Cursor Position
- ah = 09h - Write Attribute/Character at Cursor Position (Graphics)
- ah = 0Ah - Write Character at Cursor Position (Text)
- ah = 0Bh - Set Color Palette
- ah = 0Ch - Write Dot
- ah = 0Dh - Read Dot
- ah = 0Eh - Write TTY to Active Page
- ah = 0Fh - Read Video State
- ah = 10h - Set Palette Registers
- ah = 11h - Character Generator
- ah = 12h - Alternate Select
- ah = 13h - Write String
- ah = 14h - reserved (PC Convertible only)
- ah = 15h - reserved (PC Convertible only)
- ah = 16h - reserved
- ah = 17h - reserved
- ah = 18h - reserved
- ah = 19h - reserved
- ah = 1Ah - Read/Write Display Combination Code
- ah = 1Bh - Return Functionality/State Information
- ah = 1Ch - Save/Restore Video State
-
- ;***************************************************************
- Set Mode (ah = 00h)
-
- Entry: ah = 00h
- al = mode# (0..13h) => Set standard IBM mode
- = 70h => Set Everex Extended mode
- bl = Everex Extended mode number
-
- (if b7 of al is set, the video buffer is not cleared)
-
- Exit : None
-
- ;***************************************************************
- Set Cursor Type (ah = 01h)
-
- Entry: ah = 01h
- ch = Starting line for cursor
- cl = Ending line for cursor
-
- Exit : None
-
- ;***************************************************************
- Set Cursor Position (ah=02h)
-
- Entry: ah = 02h
- bh = Page#
- dh,dl = Row,column of cursor position
-
- Exit : None
-
- ;***************************************************************
- Read Cursor Position (ah=03h)
-
- Entry: ah = 03h
- bh = Page#
-
- Exit : ch,cl = Current cursor type
- dh,dl = Row,column of cursor for requested page
-
- ;***************************************************************
- Read Light Pen Position (ah=04h)
-
- NOTE: Light Pen is not available on VGA adapters.
-
- Entry: ah = 04h
-
- Exit : ah = 00h => Light pen switch not activated
- bx,cx,dx are altered
- = 01h => Light pen position successful
- bx = PEL column (0..X)
- ch = raster line (0..199) (200 line modes)
- cx = raster line (0..Y) (new graphics modes)
- dh,dl = Row,column of character
-
- ;***************************************************************
- Select Active Display Page (ah=05h)
-
- Entry: ah = 05h
- al = Page#
-
- Exit : None
-
- ;***************************************************************
- Scroll Active Page Up (ah=06h)
-
- Entry: ah = 05h
- al = # of lines to blank at the bottom
- = 00h to blank the entire window
- bh = Blanking attribute
- ch,cl = Row,column of upper left corner
- dh,dl = Row,column of lower right corner
-
- Exit : None
-
- ;***************************************************************
- Scroll Active Page Down (ah=07h)
-
- Entry: ah = 07h
- al = # of lines to blank at the top
- = 00h to blank the entire window
- bh = Blanking attribute
- ch,cl = Row,column of upper left corner
- dh,dl = Row,column of lower right corner
-
- Exit : None
-
- ;***************************************************************
- Read Attribute/Character at Cursor Position (ah=08h)
-
- Entry: ah = 08h
- bh = Page#
-
- Exit : ah = Attribute of character read (Text modes only)
- al = character read
-
- ;***************************************************************
- Write Attribute/Character at Cursor Position (ah=09h)
-
- Entry: ah = 09h
- al = Character to write
- bh = Page#
- bl = Attribute of character to write
- cx = Count of characters to write
-
- (For 256 color modes, bh is used as the background color)
- (For non-256 color graphics modes, if b7 of bl is set, the
- color value is XORed)
-
- Exit : None
-
- ;***************************************************************
- Write Character at Cursor Position (ah=0Ah)
-
- Entry: ah = 0Ah
- al = Character to write
- bh = Page#
- cx = Count of characters to write
-
- Exit : None
-
- ;***************************************************************
- Set Color Palette (ah=0Bh)
-
- Entry: ah = 0Bh
- bh = 00h => Set background color for 320x200 graphics modes
- => Set foreground color for 640x200 graphics modes
- => Set border color for alphanumeric modes
- bl = (0..31)
- = 01h => Select palette for 320x200 graphics modes
- bl = 0 => Green/red/brown
- = 1 => Cyan/magenta/white
-
- Exit : None
-
- ;***************************************************************
- Write Dot (ah=0Ch)
-
- Entry: ah = 0Ch
- al = Color value
- bh = Page#
- dx,cx = Row,column of pixel
-
- (In non-256 color modes, if b7 of al is set then the color is XORed)
-
- Exit : None
-
- ;***************************************************************
- Read Dot (ah=0Dh)
-
- Entry: ah = 0Dh
- bh = Page#
- dx,cx = Row,column of pixel
-
- Exit : al = Color value
-
- ;***************************************************************
- Write TTY to Active Page (ah=0Eh)
-
- Entry: ah = 0Eh
- al = Character to write
- bl = Foreground color (Graphics modes only)
-
- Exit : None
-
- ;***************************************************************
- Read Video State (ah=0Fh)
-
- Entry: ah = 0Fh
-
- Exit : al = Current mode#
- ah = Columns
- bh = Active page#
-
- (If an Everex Extended mode is active, al will contain the base mode)
-
- ;***************************************************************
- Set Palette Registers (ah=10h)
-
- Entry: ah = 10h
- al = 00h => Set one palette register
- bl = Palette register#
- bh = value to set
- = 01h => Set overscan register
- bh = value to set
- = 02h => Set all palette registers and overscan
- es:dx -> 17 byte table
- = 03h => Toggle intensify/blinking bit
- bl = 00h => Enable intensify
- = 01h => Enable blinking
-
- = 07h => Read one palette register
- bl = Palette register#
- Exit: bh = value read
- = 08h => Read overscan register
- Exit: bh = value read
- = 09h => Read all palette registers and overscan
- es:dx -> 17 byte table
-
- = 10h => Set individual color register
- bx = Color register# (0..FFh)
- dh = Red value (0..3Fh)
- ch = Green value (0..3Fh)
- cl = Blue value (0..3Fh)
- = 12h => Set block of color registers
- bx = First color register# (0..FFh)
- cx = Count of color registers
- es:dx -> Table of size 3*cx bytes. Each
- triple forms a Red,Green,Blue to be
- written to one color register
- = 13h => Select color page (not valid in 256 color modes)
- bl = 00h => Select paging mode
- bh = 00h => Select 4 blocks of 64 registers
- = 01h => Select 16 blocks of 16 registers
- bl = 01h => Select page
- bh = Page# (00h..03h or 00h..0Fh)
- = 15h => Read one color register
- bl = Color register#
- Exit: dh = Red value
- ch = Green value
- cl = Blue value
- = 17h => Read block of color registers
- bx = First color register# (0..FFh)
- cx = Count of color registers
- es:dx -> Table of size 3*cx bytes.
- Exit: es:dx -> Table of size 3*cx bytes. Each triple
- forms a Red,Green,Blue value read from one color
- register.
- = 18h => (Undocumented) Set PEL Mask
- bl = new PEL mask
- (This value is ANDed with each color value before looking
- up the color in the digital-to-analog converter (DAC))
- = 19h => (Undocumented) Read PEL Mask
- bl = value read
- = 1Ah => Read color page state
- Exit: bl = paging mode
- bh = current page
- = 1Bh => Sum a block of colors to gray shades
- bx = Starting color register#
- cx = # of color registers to convert
-
- ;***************************************************************
- Character Generator (ah=11h)
-
- Entry: ah = 11h
- al = 00h => User alpha font load w/set mode
- bh = bytes/character
- bl = block#
- cx = count to store
- dx = character offset to start at
- es:bp -> font table of size cx*bh bytes
- al = 01h => ROM 8x14 font load w/set mode
- bl = block#
- al = 02h => ROM 8x8 font load w/set mode
- bl = block#
- al = 03h => Set block specifier
- bl - b4,b1,b0 select normal intensity font block
- bl - b5,b3,b2 select high intensity font block
- al = 04h => ROM 8x16 load w/set mode
- bl = block#
-
- al = 10h => User alpha font load w/o set mode
- bh = bytes/character
- bl = block#
- cx = count to store
- dx = character offset to start at
- es:bp -> font table of size cx*bh bytes
- al = 11h => ROM 8x14 font load w/o set mode
- bl = block#
- al = 12h => ROM 8x8 font load w/o set mode
- bl = block#
- al = 14h => ROM 8x16 load w/o set mode
- bl = block#
-
- al = 20h => Set user graphics pointer at INT 1Fh
- es:bp -> user font table
- al = 21h => Set user graphics pointer at INT 43h for user font
- es:bp -> user font table
- cx = bytes/character
- bl = Row specifier
- = 00h => User row count
- dl = # of rows
- = 01h => 14 rows
- = 02h => 25 rows
- = 03h => 43 rows
- al = 22h => Set user graphics pointer at INT 43h for ROM 8x14
- bl = Row specifier
- al = 23h => Set user graphics pointer at INT 43h for ROM 8x8
- bl = Row specifier
- al = 24h => Set user graphics pointer at INT 43h for ROM 8x16
- bl = Row specifier
- al = 30h => Return font information
- bh = font pointer requested
- Exit: cx = bytes/character
- dl = # rows -1
- es:bp -> font requested
- bh = 00h => es:bp = INT 1Fh font pointer
- bh = 01h => es:bp = INT 43h font pointer
- bh = 02h => es:bp -> ROM 8x14 font
- bh = 03h => es:bp -> ROM 8x8 font (00h to 7Fh)
- bh = 04h => es:bp -> ROM 8x8 font (80h to FFh)
- bh = 05h => es:bp -> ROM 9x14 alt font
- bh = 06h => es:bp -> ROM 8x16 font
- bh = 07h => es:bp -> ROM 9x16 alt font
-
- ;***************************************************************
- Alternate Select (ah = 12h)
-
- Entry: ah = 12h
- bl = 10h => Return EGA information
- Exit: bh = 00h => Color mode in effect
- = 01h => Monochrome mode in effect
- bl = Memory size (0..3)
- ch = Feature connector bits
- cl = IBM EGA switch settings
- bl = 20h => Revector print screen interrupt to EGA print screen
- bl = 30h => Select # of scan lines for next text set mode
- al = 00h => 200 scan lines (invalid for mode 7)
- = 01h => 350 scan lines
- = 02h => 400 scan lines
- Exit: al = 12h if the function was supported
- bl = 31h => Enable/Disable default palette loading during set mode
- al = 00h => Enable default palette loading
- = 01h => Disable default palette loading
- Exit: al = 12h if the function was supported
- bl = 32h => Enable/Disable video
- al = 00h => Enable video
- = 01h => Disable video
- Exit: al = 12h if the function was supported
- bl = 33h => Enable/Disable gray summing
- al = 00h => Enable gray summing
- = 01h => Disable gray summing
- Exit: al = 12h if the function was supported
- bl = 34h => Enable/Disable cursor emulation
- al = 00h => Enable cursor emulation
- = 01h => Disable cursor emulation
- Exit: al = 12h if the function was supported
- bl = 36h => Video screen on/off
- al = 00h => Video screen off
- = 01h => Video screen on
- Exit: al = 12h if the function was supported
-
- For IBM PS/2 computers:
- bl = 35h => Display switch
- al = 00h => Initial adapter off
- es:dx -> 128 byte save area
- al = 01h => Initial system board video on
- al = 02h => Switch off active video
- es:dx -> 128 byte save area
- al = 03h => Switch on inactive video
- es:dx -> 128 byte save area
- al = 80h => (Undocumented) Set system board video active flag
- Exit: al = 12h if the function was supported
-
- ;***************************************************************
- Write String (ah=13h)
-
- Entry: al = string format
- = 00h => bl = attribute
- string = ch,ch,ch,... (cursor not moved)
- = 01h => bl = attribute
- string = ch,ch,ch,... (cursor moved)
- = 02h => string = ch,attr,ch,attr,... (cursor not moved)
- (text modes only)
- = 03h => string = ch,attr,ch,attr,... (cursor moved)
- (text modes only)
-
- ;***************************************************************
- Read/Write Display Combination Code (DCC) (ah=1Ah)
-
- Entry: ah = 1Ah
- al = 00h => Read DCC
- Exit: bl = active display code
- bh = alternate display code
- al = 01h => Write DCC
- bl = active display code
- bh = alternate display code
-
- Exit : al = 1Ah if the function was supported
-
- Valid display combination codes:
- 00h - no display
- 01h - monochrome adapter w/ monochrome display
- 02h - color graphics adapter w/ color display
- 03h - reserved
- 04h - Enhanced graphics adapter w/ color display
- 05h - Enhanced graphics adapter w/ monochrome display
- 06h - Professional graphics adapter w/ color display
- 07h - VGA w/ monochrome analog display
- 08h - VGA w/ color analog display
- 09h - reserved
- 0Ah - reserved
- 0Bh - MCGA w/ monochrome analog display
- 0Ch - MCGA w/ color analog display
- FFh - unknown display type
-
- ;***************************************************************
- Return Functionality/State Information (ah=1Bh)
-
- Entry: ah = 1Bh
- bx = Implementation type
- = 0000h => Return functionality/state information
- es:di -> 40h byte buffer
- (di+00) (dw)->Static functionality table
- (di+04) (b) = video mode in effect
- (di+05) (w) = # of columns
- (di+07) (w) = Length of regen buffer in bytes
- (di+09) (w) = Starting address of regen buffer
- (di+0B) (w) = Cursor position for page 0
- :
- :
- (di+19) (w) = Cursor position for page 7
- (di+1B) (w) = Cursor type
- (di+1D) (b) = Active display page
- (di+1E) (w) = CRTC port address
- (di+20) (b) = Current setting of register (3?8)
- (di+21) (b) = Current setting of register (3?9)
- (di+22) (b) = # of rows
- (di+23) (w) = bytes/character
- (di+25) (b) = DCC of active display
- (di+26) (b) = DCC of alternate display
- (di+27) (w) = # of colors supported in current mode
- (di+29) (b) = # of pages supported in current mode
- (di+2A) (b) = # of scan lines active
- (0,1,2,3) => (200,350,400,480)
- (di+2B) (b) = Primary character block
- (di+2C) (b) = Secondary character block
- (di+2D) (b) = Miscellaneous flags
- b0 - All modes on all displays on
- b1 - Gray summing on
- b2 - Monochrome display attached
- b3 - Default palette loading disabled
- b4 - Cursor emulation enabled
- b5 - 0 => Intensity
- 1 => Blinking
- b6,b7 - reserved
- (di+2E..30) (b) - reserved
- (di+31) (b) = Video memory (0,1,2,3)=>(200,350,400,480)
- (di+32) (b) = Save pointer state flags
- b0 - 512 character set active
- b1 - Dynamic save area present
- b2 - Alpha font override active
- b3 - Graphics font override active
- b4 - Palette override active
- b5 - DCC override present
- b6,b7 - reserved
- (di+33..3F) - reserved
-
- Static Funcionality Table format (10h bytes):
- +00 = Modes supported #1
- b0..b7 = 1 => corresponding mode (0,1,2,3,4,5,6,7) supported
- +01 = Modes supported #2
- b0..b7 = 1 => corresponding mode (8,9,A,B,C,D,E,F) supported
- +02 = Modes supported #3
- b0..b3 = 1 => corresponding mode (10,11,12,13) supported
- b4..b7 - reserved
- +03..+06 - reserved
- +07 = Scan lines supported
- b0..b2 = 1 => corresponding lines (200,350,400) supported
- in text modes
- +08 = Maximum number of active character blocks in text modes
- +09 = Total blocks available in text modes
- +0A = Miscellaneous function flags #1
- b0 - All modes on all displays function supported
- b1 - Gray summing function supported
- b2 - Character font loading function supported
- b3 - Default palette loading enable/disable supported
- b4 - Cursor emulation function supported
- b5 - EGA palette present
- b6 - Color palette present
- b7 - Color paging function supported
- +0B = Miscellaneous funcion flags #2
- b0 - Light pen supported
- b1 - Save/restore state function 1C supported
- b2 - Intensity/blinking function supported
- b3 - Display Combination Cide (DCC) supported
- b4..b7 - reserved
- +0C..+0D - reserved
- +0E = Save pointer function flags
- b0 - 512-character set supported
- b1 - Dynamic save area supported
- b2 - Alpha font override supported
- b3 - Graphics font override supported
- b4 - Palette override supported
- b5 - DCC extension supported
- b6,b7 - reserved
- +0F - reserved
-
- ;***************************************************************
- Save/Restore Video State (ah=1Ch)
-
- Entry: ah = 1Ch
- cx = Requested states
- b0 - Video hardware
- b1 - BIOS data areas
- b2 - Color registers and state
- b3..b7 - reserved
- al = 00h => Calculate buffer size for requested statesin 64 byte blocks
- Exit: bx = buffer size to save requested states
- al = 01h => Save requested states
- es:bx -> Buffer of sufficient size to save requested states
- al = 02h => Restore requested states
- es:bx -> Buffer containing previously saved state
-
- Exit : al = 1Ch => Function supported
-
- ;***************************************************************
-